package com.mera.tektronix.csviewer.controllers



import grails.test.mixin.*
import org.junit.*

/**
 * See the API for {@link grails.test.mixin.web.ControllerUnitTestMixin} for usage instructions
 */
@TestFor(DispatcherController)
class DispatcherControllerTests {

    void testGetListRedirectToDepartment() {
		params.node = "_treeRoot_"
		request.method = "POST"
		
		controller.getList()
		assert response.redirectedUrl =~ '/department/getList'
    }
	
	void testGetListRedirectToProject() {		 
		params.node = "_DEP_1"
		request.method = "POST"
		
		controller.getList()
		assert response.redirectedUrl =~ '/project/getList'
	}
	
	void testGetListRedirectToEmployee() {
		params.node = "_PRJ_1"
		request.method = "POST"

		controller.getList()
		assert response.redirectedUrl =~ '/employee/getList'
	}
	
}
